<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>dom对象</title>
	<script type="text/javascript">
		window.onload = function  () {
			// box = document.getElementById('box');
			// 
			// box = document.getElementsByTagName('div');
			// 
			// 
			box = document.getElementsByClassName('son');
			// alert(box);
			
			box[1].style.backgroundColor="red";
		}
	</script>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background: blue url() 0 0 no-repeat;
		}
		.box1{
			width: 300px;
			height: 300px;
			background: blue url() 0 0 no-repeat;
		}
	</style>
</head>
<body>
	<div class="box son" id="box">
		1

	</div>
	<div class="box1 son" >
		2

	</div>

	
</body>
</html>